# Managing user and group roles using the Compose CLI

You can set and update user and group roles using the Compose CLI. You can also remove users and groups from a role in one of the available scopes (for example, Admin in All Projects). This is especially useful if you need to automate project deployment. Before you can use the CLI, you must first run the `Connect` command as described in [Connecting to Qlik Compose server](https://help.qlik.com/en-US/compose/December2024/Content/ComposeDWDL/Main/DW/Projects/connect_to_compose_server.htm).

## Adding or updating roles

You can add a new user or group and assign a role to that user/group, or you can update the role of an existing user or group. If the specified user or group does not exist, they will be added to Compose.

### Syntax

composecli set\_user\_or\_group\_role --scope global|allprojects|project [--project\_name project-name] --role admin|designer|operator|viewer|none --user\_name netbios\user|--group\_name netbios\group

### Parameters

| Parameter | Description |
| --- | --- |
| scope | The scope of the user or group: global, allprojects, or project. |
| role | Required. The role that you want to assign the user or group: none, viewer, operator, designer, or admin. |
| project\_name | The name of the project to assign the role on. Only required if --scope project. |
| user\_name | The name of the user to add or update. Required if no group is specified.<br><br>Users must be specified in the following format:<br><br>NetBIOS-name\user<br><br>Example:<br><br>qa\mike |
| group\_name | The name of the group to add or update. Required if no user is specified.<br><br>Users must be specified in the following format:<br><br>NetBIOS-name\group<br><br>Example:<br><br>qa\admins |

### Example

composecli set\_user\_or\_group\_role --scope project --project\_name myproject --role admin --group\_name qa\admins

## Revoking roles

You can revoke a user or group's role from a particular project, from all projects, or from Compose.

### Syntax

composecli remove\_user\_or\_group\_role --scope global|allprojects|project [--project\_name project-name] --user\_name netbios\user|--group\_name netbios\group

### Parameters

| Parameter | Description |
| --- | --- |
| scope | The scope of the user or group to remove: global, allprojects, or project. |
| project\_name | The name of the project to remove the user or group from. Only required if --scope project. |
| user \_name | The name of the user to remove. Required if no group is specified.<br><br>Users must be specified in the following format:<br><br>NetBIOS-name\user<br><br>Example:<br><br>qa\mike |
| group\_name | The name of the group to remove. Required if no user is specified.<br><br>Users must be specified in the following format:<br><br>NetBIOS-name\group<br><br>Example:<br><br>qa\admins |

### Example

composecli remove\_user\_or\_group\_role --scope project --project\_name myproject --user\_name qa\mike